package xml;

public final class Attribute {
    private final transient String name;
    private final transient String attribute;

    public Attribute(final String nameParam, final String attributeParam) {
        if (nameParam.contains(" ") || nameParam.contains("\t")) {
            throw new IllegalArgumentException("name of the attribute contains whitespaces: " + nameParam);
        }

        this.name = nameParam;
        this.attribute = attributeParam;
    }

    @Override
    public String toString() {
        return name + "=\"" + attribute + "\"";
    }
}
